/*
 * @Author: deliteam 462085920@qq.com
 * @Date: 2022-12-14 17:15:08
 * @Description:
 */
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('products')
export class Product {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  name: string;

  @Column({ nullable: true })
  addr: string;

  @Column({ nullable: true })
  route: string;

  @Column()
  pic: string;

  @Column('mediumtext', { nullable: true })
  atlas: string;

  @Column()
  category: string;

  @Column('mediumtext', { nullable: true })
  intro: string;

  @Column('mediumtext', { nullable: true })
  content: string;

  @Column({
    default: false,
  })
  recommend: boolean;

  @Column()
  status: boolean;

  @Column({ type: 'json' }) // 使用 type 设置为 'json'
  extendData: object; // 将 JSON 字符串映射为 JavaScript 对象类型

  @Column({
    select: false,
  })
  createdAt: Date;

  @Column()
  updatedAt: Date;
}
